<?php

namespace App\Http\Controllers\Seller;

use App\Models\PostItem;

class IndexController extends BaseController
{
    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index(){

        $this->assign([
            'shop' => $this->user()->shop,
            'wallet' => $this->user()->wallet,
            'waitPayCount'=>$this->user()->solds()->where('trade_status', 1)->count(),
            'waitSendCount'=>$this->user()->solds()->where('trade_status', 2)->count(),
            'postList'=>PostItem::where(['status'=>1])->limit(6)->orderByDesc('aid')->get()
        ]);

        return $this->view('seller.index');
    }

    public function n()
    {

        return $this->view('seller.new');
    }
}
